import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';

import { PcUpgrade } from '../../services/pc-upgrade';
import { LastUrlService } from '../../services/last-url.service';

@Component({
    selector: 'm-pc-upgrade-list',
    templateUrl: './pc-upgrade-list.component.html',
    styleUrls: ['./pc-upgrade-list.component.scss']
})
export class PcUpgradeListComponent implements OnInit {
    constructor(private route: ActivatedRoute,
        private urlService: LastUrlService) { }

    result$ = this.route.data.pipe(map(data => data['list']));

    ngOnInit() {
        this.route.url.subscribe(urls => this.urlService.setURL(urls.join(',')));
    }

    downloadLog(item: PcUpgrade) {
    }
}
